/**
 * Created with IntelliJ IDEA.
 * Description:创建一个 int 类型的数组, 元素个数为 100, 并把每个元素依次设置为 1 - 100
 * User: xwl
 * Date: 2023-04-03
 * Time: 20:07
 */
public class Test6 {
    public static void main(String[] args) {
        //创建元素个数为一百的数组
        int[] array = new int[100];
        //依次赋值
        for (int i = 0; i < array.length; i++) {
            array[i] = i + 1;
        }
        //定义一个计数器
        int count = 0;
        //输出
        for (int x: array) {
            System.out.print(x+" ");
            count++;
            if(count == 10) {
                System.out.println();
                count = 0;
            }
        }
    }
}
